import { Component, OnInit} from '@angular/core';
import { JsonApiService } from "app/core/api/json-api.service"; //http请求配置引入
import { Router, ActivatedRoute } from "@angular/router"; //路由引入
import { config } from '../../shared/smartadmin.config';

declare var $: any;
@Component({
	selector: 'sa-repaired-daily-detail',
	templateUrl: './repaired-daily-detail.component.html',
	styleUrls: ['./repaired-daily-detail.component.css']
})
export class RepairedDailyDetailComponent implements OnInit {
	parentRowId:any; // 维修日报ID
	dailyDetail:any; //日报详情
	constructor(private jsonApiService: JsonApiService, private router: Router, private activatedRoute: ActivatedRoute) {
        activatedRoute.queryParams.subscribe(queryParams => {
            this.parentRowId = queryParams.id || '';
        });
    }
	ngOnInit() {
		this.load();
	}
	ngOnDestroy() {}
	//初始化加载list数据
	load() {
		this.jsonApiService.http_obj("sanitation/sanitationReport/sanitationReportDetail.html", {id: this.parentRowId}).subscribe(result => {
			if(result.success){
			    this.dailyDetail = result.data;  
			}
		})
	}
	// 返回维修日报
	goBack(){
	    this.router.navigate(['/installation-management/repaired-daily']);
	}
}